<html>
<head>
<title>Metadaten eingeben</title>
  <style type="text/css">@import "template-dragon_form-style.css";</style>
  <script language="JavaScript" src="jquery.js"></script>
  <script language="JavaScript" src="jquery.validation.js"></script>
  <script type="text/javascript"> 
    $(document).ready(function() { 
       $("#form1").validate({ 
         rules: { 
           title: "required",
           author: "required"
         } 
       }); 
     }); 
   </script>
</head>
<body>
    <?php
       	  $meta_id=$_GET['meta_id']; ?>
    <form id="form1" method="post" action="meta_data_handler.php?meta_id=<?php echo $meta_id; ?>"> 
    
    <?php
    require_once('config.inc.php');
    $dbname = DB_NAME;
    MYSQL_CONNECT(DB_SERVER,DB_USER_NAME,DB_USER_PASSWORD) OR DIE("Datenbankverbindung konnte nicht hergestellt werden!");
    @mysql_select_db("$dbname") or die("Datenbank nicht gefunden!"); 
    $meta_id=$_GET['meta_id'];     
    $query = "SELECT * FROM metadata WHERE meta_id = '$meta_id'";
    $result = mysql_query($query) or die(mysql_error()); 
    
  	while($row = mysql_fetch_object($result)) 
		{ 
			$title = $row->title;
			$author = $row->author;
			$creation_date = $row->creation_date;
			$last_edit = $row->last_edit;
			$description = $row->description;
			$tag1 = $row->tag1;
			$tag2 = $row->tag2;
			$tag3 = $row->tag3;
			$tag4 = $row->tag4;
			$tag5 = $row->tag5;
		}    
    ?>
        <div class="form-row"><span class="label">Titel</span><input type="text"  name="title" value="<?php echo $title; ?>" /></div> 
        <div class="form-row"><span class="label">Autor</span><input type="text" name="author" value="<?php echo $author; ?>" /></div> 
        <div class="form-row"><span class="label">Beschreibung</span><input type="text" name="description" value="<?php echo $description; ?>" /></div> 
        <div class="form-row"><span class="label">Tag1</span><input type="text" name="tag1" value="<?php echo $tag1; ?>" /></div>
        <div class="form-row"><span class="label">Tag2</span><input type="text" name="tag2" value="<?php echo $tag2; ?>" /></div>
        <div class="form-row"><span class="label">Tag3</span><input type="text" name="tag3" value="<?php echo $tag3; ?>" /></div>
        <div class="form-row"><span class="label">Tag4</span><input type="text" name="tag4" value="<?php echo $tag4; ?>" /></div>
        <div class="form-row"><span class="label">Tag5</span><input type="text" name="tag5" value="<?php echo $tag5; ?>" /></div>
        <div class="form-row"><input class="submit" type="submit" value="Submit"></div> 
    </form> 
</body>
</html>